package com.holly.controller;

import com.holly.pojo.OperateLog;
import com.holly.pojo.PageResultData;
import com.holly.pojo.Result;
import com.holly.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author holly
 * @create 2025-07-08 14:33
 */
@Slf4j
@RequestMapping("/log")
@RestController
public class LogController {
    @Autowired
    private LogService logService;

    @GetMapping("/page")
    public Result page(@RequestParam(defaultValue = "1") Integer page, // 默认值1
                       @RequestParam(defaultValue = "10") Integer pageSize){
        log.info("分页查询，参数：pageNum={},pageSize={}",page,pageSize);
        PageResultData<OperateLog> pageResultData = logService.page(page,pageSize);
        return Result.success(pageResultData);
    }
}
